package top.forforever.srb.core.controller.api;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.forforever.srb.common.exception.Assert;
import top.forforever.srb.common.result.R;
import top.forforever.srb.common.result.ResponseEnum;
import top.forforever.srb.core.pojo.entity.Dict;
import top.forforever.srb.core.service.DictService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 * 数据字典 前端控制器
 * </p>
 *
 * @author Mr.Jiang
 * @since 2023-04-29
 */
@RestController
@RequestMapping("/api/core/dict")
public class ApiDictController {

    @Autowired
    private DictService dictService;

    @GetMapping("getDictListByDictCode/{dictCode}")
    public R getDictListByDictCode(@PathVariable String dictCode) {
        List<Dict> dictList = dictService.getDictListByDictCode(dictCode);
        return R.ok().data("dictList",dictList);
    }

}

